/** @jsxImportSource @emotion/react */
import * as React from "react";
import {TableRow, CCell, Table, TableBody} from "customize-easy-ui-component";
import {DirectLink, } from "../../../routing/Link";
import Img_Seal from "../../../images/seal.png";
import {AttentionPoint} from "../../common/rarelyVary";

export const 编制核准人员= ({ orc,rep,jyprf='下次定期检验',bianzi='编制'} : { orc: any, rep:any,jyprf?:string,bianzi?:string}
) => {
  return <Table fixed={ ["8.1%","30%","14%","4.3%","12%","%"] }  css={ {borderCollapse: 'collapse' } } tight miniw={800}>
    <TableBody>
      <DirectLink  href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/Conclusion`}>
        <TableRow>
          <CCell>检验日期</CCell>
          <CCell>{orc.检验日期 || '／'}</CCell>
          <CCell colSpan={3}>{jyprf}日期</CCell>
          <CCell>{orc.新下检日}</CCell>
        </TableRow>
        <TableRow>
          <CCell>检验人员</CCell>
          <CCell colSpan={5}>{orc.检验人IDs}</CCell>
        </TableRow>
        <TableRow>
          <CCell>{bianzi}</CCell>
          <CCell colSpan={2}>{orc.检验人IDs}</CCell>
          <CCell>日期</CCell>
          <CCell>{orc.检验日期 || '／'}</CCell>
          <CCell rowSpan={3}>
            <div css={{
              height:'6rem',
              '::before': {
                filter: 'opacity(30%)',
                width: '100%',
                height: '100%',
                backgroundImage: `url(${Img_Seal})`,
                content: '" "',
                position: 'absolute',
                top: 0,
                left: 0,
                backgroundRepeat: 'no-repeat',
                backgroundPosition: 'center',
              }
            }}>
              <Table  fixed={ ["40%","%"]  }
                      css={ {borderCollapse: 'collapse',height:'fill-available'}} tight miniw={800}>
                <TableBody>
                  <TableRow>
                    <CCell css={{border:'none'}}>机构核准证号：</CCell>
                    <CCell css={{border:'none'}}>{rep?.isp?.ispu?.agency?.apno}</CCell>
                  </TableRow>
                  <TableRow>
                    <CCell css={{border:'none'}} colSpan={2}>（检验机构公章或者检验专用章）</CCell>
                  </TableRow>
                </TableBody>
              </Table>
            </div>
          </CCell>
        </TableRow>
      </DirectLink>
      <TableRow>
        <CCell>审核</CCell>
        <CCell colSpan={2}></CCell>
        <CCell>日期</CCell>
        <CCell></CCell>
      </TableRow>
      <TableRow >
        <CCell>批准</CCell>
        <CCell colSpan={2}></CCell>
        <CCell>日期</CCell>
        <CCell></CCell>
      </TableRow>
    </TableBody>
  </Table>;
};

export const 注意事项mMs= ({comply, rep} :{comply: any, rep: any}
) => {
  //组件AttentionPoint只带了第一行的内容 1．本报告{comply}。<br/>  参数telurl：是否显示报检方式；最后一行跟随的！
  return <AttentionPoint rep={rep} comply={comply} telurl>
    2．本报告应当由计算机打印输出，或者用钢笔、签字笔填写，字迹要工整，涂改无效。<br/>
    3．本报告无检验、审核、批准人员的签字和检验机构的核准证号、检验专用章或者公章无效。<br/>
    4．本报告一式三份，由检验机构、施工单位和使用单位分别保存。<br/>
    5．受检单位对本报告结论如有异议，请在收到报告书之日起15个工作日内，向检验机构提出书面意见。<br/>
    6．本报告对检验时的设备状况负责。<br/>
    7．有关检测数据未经允许，施工、使用单位不得擅自向社会发布信息。<br/>
    8．根据《中华人民共和国特种设备安全法》，使用单位应在下次检验日期届满前1个月，向检验机构提出定期检验申请。<br/>
    9．
  </AttentionPoint>;
};
